using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace R2ML
{

    public class SourceCode
    {
        public class Method
        {

            [XmlText(Type = typeof(string))]
            public String Name
            {
                get
                {
                    return _name;
                }
                set
                {
                    _name = value;
                }
            }

            /// <summary>
            /// Is it a reference to a method or the actual method. Is it static/virtual/sealed etc. Specifying a modfier such as public implies it is a declaration.
            /// </summary>
            [XmlAttribute("Type")]
            public String Type
            {
                get
                {
                    return _type;
                }
                set
                {
                    _type = value;
                }
            }

            String _type = "public";
            String _name = "methodName";
        }

        public class Body
        {
            [XmlText(Type = typeof(string))]
            public String Code
            {
                get
                {
                    return _code;
                }
                set
                {
                    _code = value;
                }
            }

            String _code = @"//Code goes here";
        }


        [XmlAttribute("Language")]
        public String Language
        {
            get
            {
                return _language;
            }
            set
            {
                _language = value;
            }
        }

        [XmlElement("Method")]
        public Method MethodInstance
        {
            get
            {
                return _method;
            }
            set
            {
                _method = value;
            }
        }

        [XmlElement("Body")]
        public Body BodyInstance
        {
            get
            {
                return _body;
            }
            set
            {
                _body = value;
            }
        }

        String _language = "C#";
        Method _method;
        Body _body;
    }
}
